package com.lenovo.lcdm.dcm.common.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 使用TTL线程池，就可以传递TTL线程上下文
 * TODO 未来用户权限体系定下来，这块需要做修改
 *
 * @author
 */
public class UserContext {
    private UserContext() {
    }

    private static final ThreadLocal<String> itCodeHolder = new TransmittableThreadLocal<>();

    public static void putItCode(String itCode) {
        itCodeHolder.set(itCode);
    }

    public static void clear() {
        itCodeHolder.remove();
    }

    public static String getItCode() {
        return itCodeHolder.get();
    }

}
